package com.ymatou.query.trading.api.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.query.trading.api.parameter.GetPayBankListBean;
import com.ymatou.query.trading.api.service.GetPayBankListCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.utils.constant.ECode;

/**
 * 获取支付银行列表 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_GetPayBankList {

	private static GetPayBankListBean getpaybanklistbean;
	private static GetPayBankListCall getpaybanklistcall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取支付银行列表");
	}

	@Before
	public void caseUp() {

		getpaybanklistbean = new GetPayBankListBean();
		getpaybanklistcall = new GetPayBankListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getpaybanklistcall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetPayBankList_001() {
		Logger.start(true,"获取支付银行列表");
		try {
			// 发送请求
			getpaybanklistcall.setData(getpaybanklistbean);
			getpaybanklistcall.callService();
			Logger.comment("paybanklistcall send:" + getpaybanklistcall.getEntityString());
			Logger.comment("paybanklistcall response:" + getpaybanklistcall.getReturnData());
			Logger.verifyEquals(ECode.SUCCESS, getpaybanklistcall.getCode(), "验证Code");
			// Logger.verifyEquals(ErrorCode.SUCCESSMSG,
			// getpaybanklistcall.getMsg(), "验证Msg");
			Logger.verifyEquals(true, getpaybanklistcall.getPayBankList().length() > 0, "验证银行列表结果");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}